import inner.Person;

import java.lang.reflect.Field;

public class Test {

    static class People {

        public People(int a){
            age = a;
        }
        public int age;
    }

    static class Student{
        public final String name = "BB";
        public final People s = new People(12);
    }

    public static void main(String[] args) {
        Student s = new Student();
        System.out.println(s.name);
        try{
            Class cs = Student.class;
            Field fname = cs.getDeclaredField("name");
            fname.setAccessible(true);
            fname.set(s, "CC");
            Field fs = cs.getDeclaredField("s");
            fs.setAccessible(true);
            fs.set(s, new People(34));
            System.out.println(s.name);
            System.out.println(s.s.age);
            System.out.println(fname.get(s));
        }catch (Exception e){

        }
    }
}
